#ifndef UNIXSYSTEMTRAY_H
#define UNIXSYSTEMTRAY_H

#include "SystemTrayInterface.h"

class QSystemTrayIcon;

class UnixSystemTray : public SystemTrayInterface
{
    Q_OBJECT
public:
    UnixSystemTray(const QIcon &icon, QObject *parent);
    virtual ~UnixSystemTray();

    void setIcon(const QIcon &icon);
    void setContextMenu(QMenu *menu);
    void setVisible(bool visiable);

    void startBlink();
    void stopBink();

private:
    QSystemTrayIcon *m_tray = nullptr;
    QTimer *m_blinkTimer = nullptr;
    QIcon m_icon;

protected slots:
    void onActivate(QSystemTrayIcon::ActivationReason reason);
    void onBlink();
};

#endif // UNIXSYSTEMTRAY_H
